//
//  UIBarbuttonItemextention.swift
//  sinaWeiboswift
//
//  Created by 段文杰 on 16/4/13.
//  Copyright © 2016年 段文杰. All rights reserved.
//

import UIKit


extension UIBarButtonItem{

//    func imageName(image: String,target: AnyObject,action: Selector)->UIBarButtonItem{
//    
//        let button = UIBarButtonItem()
//        button.set
//        
     convenience init(imageName: String,target: AnyObject,action: Selector) {
        let button = UIButton()
        button.setImage(UIImage.init(named: imageName), forState: .Normal)
        button.setImage(UIImage.init(named: "\(imageName)_highlighted"), forState: .Selected)
        button.sizeToFit()
        button.addTarget(target, action: action, forControlEvents: .TouchUpInside)
        self.init(customView: button)
        
    }
    
    
    
    
 





}
